<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">
    var string = 'abcdef';
    /**
     * 根据下标截取指定的字符串
     * https://www.runoob.com/jsref/jsref-substring.html
     *
     * 参数1：起始下标
     * 参数2：结束下标，不包含结束下标
     */
    var str = string.substring(1, 2);
    console.log(str, string); // b abcdef
</script>

</html>
